//
//  EventKitController.h
//  TestCalendar
//
//  Created by mal on 14-1-9.
//  Copyright (c) 2014年 mal. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <EventKit/EventKit.h>
#import <EventKitUI/EventKitUI.h>

extern NSString * const RemindersModelChangedNotification;
extern NSString * const RemindersAccessGranted;
#define kRemindersCalendarTitle @"shangwutingCalendar"

@interface EventKitController : NSObject

@property (strong, nonatomic)EKEventStore *eventStore;
@property (assign, nonatomic)BOOL eventAccess;
@property (assign, nonatomic)BOOL reminderAccess;

@property (strong, nonatomic)NSMutableArray *reminders;

- (void)addEventWithName:(NSString*)eventName startTime:(NSDate*)startDate endTime:(NSDate*)endDate;
- (BOOL)addReminderWithTitle:(NSString*)title dueTime:(NSDate*)dueDate mode:(int)recurrenceMode;
- (BOOL)saveRminder:(EKReminder*)reminder;
- (BOOL)removeReminder:(EKReminder*)reminder;

- (EKCalendar*)calendarForReminders;

- (void)fetchAllReminders;
- (void)startBroadcastingModelChangedNotifications;
- (void)stopBroadcastingModelChangedNotifications;
- (void)reminder:(EKReminder*)reminder setCompletionFlagTo:(BOOL)completionFlag;

- (void)showVC;

@end
